package com.startdima.user.infrastructure.mapper;

import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.factory.Mappers;

import com.startdima.user.domain.entity.UserInfo;
import com.startdima.user.infrastructure.bo.AuthUserBo;
import com.startdima.user.infrastructure.vo.UserInfoAddOrUpdateVo;
import com.startdima.user.infrastructure.vo.UserInfoVo;

@Mapper(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
public interface UserMapper {
	
	UserMapper INSTANCE = Mappers.getMapper(UserMapper.class);
	
    AuthUserBo toAuthUserBo(UserInfo userEntity);
    
    UserInfo toUserInfo(UserInfoAddOrUpdateVo aInfoAddOrUpdateVo);
    
    UserInfoVo toUserInfoVo(UserInfo userEntity);
    
    UserInfo updateUserInfo(UserInfoAddOrUpdateVo source, @MappingTarget UserInfo target);

}
